abstract class Fruit {
	abstract double getWeight();
}

class Apple extends Fruit {
	double getWeight() {
		//System.out.println(this.getClass().getName());
		return 1;
	}
}

class Peach extends Fruit {
	double getWeight() {
		//System.out.println(this.getClass().getName());
		return 2;
	}
}

class Orange extends Fruit {
	double getWeight() {
		//System.out.println(this.getClass().getName());
		return 3;
	}
}
class Main {
	public static void main(String[] args) {
		Fruit[] a = {new Apple(), new Peach(), new Orange()};
		for (int i = 0; i < a.length; i++) {
			System.out.println(a[i].getClass().getName());
			System.out.println(a[i].getWeight());
			
			
		}
	}
}
